#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<assert.h>

size_t my_stlen(const char* arr)
{
	assert(arr);
	int count = 0;
	while (*arr++!='\0')
	{
		count++;
	}
	return count;
}
void palin(char* left,char* right)
{
	while (left < right)
	{
		char tmp = *left;
		*left = *right;
		*right = tmp;
		left++;
		right--;
	}
}


int main()
{
	char arr[] = "i like bejing.";//".hnijeb ekil i"
	int len = my_stlen(arr);
	palin(arr,arr+len-1);
	char* str = arr;

	while (*str)
	{
		char* ctr = str;
		while (*str != ' ' && *str !='\0')
		{
			str++;
		}
		palin(ctr, str - 1);
		if (*str != '\0')
		{
			str++;
		}
	}


	printf("%s", arr);

	return 0;
}